package com.tuanzi.loan.web.lazy.family;

import org.springframework.data.domain.Page;

import com.tuanzi.loan.business.service.family.LoanApiOrderService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.LoanApiOrderSearchRequest;
import com.tuanzi.loan.vo.response.family.LoanApiOrderSearchResponse;

public class LoanApiOrderLazyDataModel extends
        BaseLazyDataModel<LoanApiOrderSearchRequest, LoanApiOrderSearchResponse> {

    private static final long serialVersionUID = 9143007553234885156L;

    private LoanApiOrderService loanApiOrderService = SpringContextHolder.getBean(LoanApiOrderService.class);

    public LoanApiOrderLazyDataModel(LoanApiOrderSearchRequest searchRequest) {
        super(searchRequest);
    }

    @Override
    protected Page<LoanApiOrderSearchResponse> doLoad(PageSearcher<LoanApiOrderSearchRequest> pageSearcher) {
        return loanApiOrderService.list(pageSearcher);
    }
}
